<template>
	<view class="content">
		<view class="head-area">
			<!-- <img src="../../static/details/back.png" class="back" @tap="handleBack()"></img> -->
			<img src="../../static/logo.png" class="logo"></img>
		</view>
		<view class="container">
			<view class="content-box">
				<img src="../../static/qr_title.png" class="qr_title"></img>
				<view class="qr-box" v-if="userData.qrCode">
					<view class="code">
						<img :src="userData.qrCode" style="width: 300rpx; "></img>
					</view>
					<!-- <view class="info">
						姓名：{{userData.name}}
					</view> -->
					<!-- v-if="userData.signTotalNumber < 1600" -->
					<view class="info" >
						座位区域：{{userData.seatNumber}}
					</view>
					<view class="info" >
						晚宴桌号：{{userData.tableNumber}}
					</view>
				</view>
			</view>
			<!-- 全天  -->
			<view class="guide" v-if="userData.guestType == '全场'">
				<img src="../../static/details/chzn_all_1.png" class="guide_img"></img>
				<img src="../../static/details/chzn_all_2.png" class="guide_img"></img>
				<img src="../../static/details/chzn_all_3.png" class="guide_img"></img>
				<img src="../../static/details/chzn_all_4.png" class="guide_img"></img>
				<div style="background-color: #1e195f;">
					<img src="../../static/footer_logo.png" class="guide_img" style="width: 85%; margin: 0 auto;"></img>
				</div>
			</view>
			<!-- 半天 -->
			<view class="guide" v-if="userData.guestType == '半场'">
				<img src="../../static/details/chzn_all_1.png" class="guide_img"></img>
				<img src="../../static/details/chzn_half_2.jpg" class="guide_img"></img>
				<img src="../../static/details/chzn_common.jpg" class="guide_img"></img>
				<!-- <img src="../../static/details/chzn_half_4.jpg" class="guide_img"></img> -->
			</view>
		</view>
	</view>
</template>

<script>
	// import RobotData from '@/components/robot/robot.vue';
	export default {
		components: {
			// RobotData
		},
		data() {
			return {
				userData: {}
			}
		},
		onLoad() {
			this.getInfo()
		},
		methods: {
			getInfo() {
				// 网络请求
				uni.showLoading({
					title: '请求中',
				});
				uni.request({
					url: 'https://flow.btvs.cn/api/basic/guest/getInfo',
					method: 'GET',
					header: {
						Authorization: uni.getStorageSync('token')
					},
					dataType: 'json',
					success: (res) => {
						uni.hideLoading();
						if (res.data.code == 200) {
							this.userData = {
								...res.data.data
							}


						} else {
							uni.showToast({
								title: res.data.msg,
								icon: "error"
							})
							if (res.data.code == 401) {
								setTimeout(() => {
									uni.navigateTo({
										url: '/pages/index/index'
									})
								}, 1500)
							}
						}
					},
					fail: () => {
						uni.hideLoading();
						uni.showToast({
							title: '网络开小差了~',
							icon: "error"
						})
					},
				});
			},
			handleBack() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="less">
	.content {
		padding-top: 200rpx;
		height: 100%;
		background-image: url('../../static/qd_bg.jpg');
		background-color: #21086e;
		background-size: cover;
		background-repeat: no-repeat;
		background-position: center;

		.head-area {
			padding: 0 60rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			position: absolute;
			top: 60rpx;
			left: 0;
			z-index: 9;

			.back {
				width: 80rpx;
			}

			.logo {
				width: 260rpx;
			}
		}



		.container {
			// padding-top: 200rpx;
			overflow: auto;
			height: calc(100% - 40rpx);

			.title {
				font-family: Arial, Helvetica, sans-serif;
				text-align: center;
				font-size: 40rpx;
				font-weight: 600;
				color: #000;
			}


			.content-box {
				padding: 30rpx 60rpx 30rpx;
				text-align: center;


				.qr_title {
					max-width: 70%;
					margin: 0 auto;
				}

				.qr-box {
					margin-top: 60rpx;
					margin-left: 12%;
					padding: 60rpx;
					width: 78%;
					// height: 400rpx;
					// background-color: #002f6c;
					background-image: url('/static/qr_bg.png');
					background-repeat: no-repeat;
					background-size: 100% 100%;
					// border-radius: 10px;
					// box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);

					img {
						// border-radius: 32rpx;
					}

					.info {
						margin-top: 32rpx;
						font-size: 36rpx;
						color: #fff;
					}
				}
			}
		}

		.guide {
			padding: 30rpx;

			.guide_img {
				max-width: 100%;
				display: block;
			}
		}
	}
</style>